set hitpoint to point(the mouseH - the left of sprite me, the mouseV - the top of sprite me)
if whichway = #down then
set controlslist to groommousedownslist
if the name of the mouseMember contains "light" then
puppetSound(2, "Button")
updateStage()
end if
else
set controlslist to groommouseupslist
end if
set mycontrol to getAt(controlslist, me)
if not listp(mycontrol) then
return #notcontrol
end if
if count(mycontrol) < 2 then
return #notcontrol
end if
set hitlist to getAt(mycontrol, 1)
if not listp(hitlist) then
return #notcontrol
end if
set actionlist to getAt(mycontrol, 2)
if not listp(actionlist) then
return #notcontrol
end if
if (count(actionlist) <> count(hitlist)) or (count(hitlist) = 0) then
return #badcontrol
end if
repeat with i = 1 to count(hitlist)
if inside(hitpoint, getAt(hitlist, i)) then
puppetSprite(hiliterect, 0)
set the locV of sprite 2 to getAt(actionlist, i)
repeat with spriteNum = 2 to endSprite - 1
setlistposition()
end repeat
exit repeat
end if
end repeat
end
on checkroomrollover whichway
set noroll to 1
repeat with i = hiliterect - 1 down to 1
if rollOver(i) then
if (listp(getAt(groommouseupslist, i)) and ((whichway = #up) or (whichway = #both))) or (listp(getAt(groommousedownslist, i)) and ((whichway = #down) or (whichway = #both))) then
hiliteroomcontrol(i, whichway)
set noroll to 0
exit repeat
end if
end if
end repeat
if noroll then
set the locH of sprite hiliterect to -1000
end if
end
on hiliteroomcontrol contnum, whichway
set norect to 1
if (whichway = #up) or (whichway = #both) then
set upcont to getAt(groommouseupslist, contnum)
if not listp(upcont) then
set uprects to []
end if
if count(upcont) < 2 then
set uprects to []
end if
if voidp(uprects) then
set uprects to getAt(upcont, 1)
else
nothing()
end if
else
set uprects to []
end if
if (whichway = #down) or (whichway = #both) then
set downcont to getAt(groommousedownslist, contnum)
if not listp(downcont) then
set downrects to []
end if
if count(downcont) < 2 then
set downrects to []
end if
if voidp(downrects) then
set downrects to getAt(downcont, 1)
else
nothing()
end if
else
set downrects to []
end if
set rectlist to combo(uprects, downrects)
set hoff to the left of sprite contnum
set voff to the top of sprite contnum
set where to point(the mouseH - hoff, the mouseV - voff)
set mouseposition to point(the mouseH, the mouseV)
repeat with r in rectlist
if inside(where, r) and (the mouseH < 425) then
set order to getOne(rectlist, r)
set roomhilite to string(getAt(roomlist, order)) && "light"
set the memberNum of sprite hiliterect to the number of member roomhilite